package com.ajie.ft_kvdata;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.orhanobut.hawk.Hawk;

import java.util.Iterator;
import java.util.Map;

public class HawkActivity extends AppCompatActivity {
    private static final String TAG = "HawkActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hawk);


        Hawk.init(this).build();
    }

    int count = 0;
    public void putSP( View view) {
        boolean put = Hawk.put((count) + "key", count + " value");
        Log.i(TAG, "putSp: p"+put);
    }


    public void spForEach(View view) {
        String key = count + "key";
        String v = Hawk.get(key);
        Log.i(TAG, "get: k:"+key+"  v:"+v);
        count++;
    }
}